<template>
    <van-nav-bar title="个人中心" left-text="返回" right-text="退出" 
    left-arrow @click-left="onClickLeft" @click-right="exit" />

    <div class="content">
      <van-cell-group title="个人中心">
        <van-cell title="地址管理" is-link to="/address" />
        <van-cell title="订单中心" is-link to="/order" />
      </van-cell-group>
    </div>

</template>
 
<script setup lang="ts">
import { useRouter } from 'vue-router';


const router = useRouter()

const onClickLeft = () => history.back();

// 简单的方式
const exit = () => {
    alert('确定退出吗？')
    localStorage.removeItem('userid')
    localStorage.removeItem('token')
    router.replace('/login')
} 



</script>
 
<style></style>